﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Dominio.Logica;

namespace Interfaz
{
    public partial class Logs : Form
    {
        public Logs()
        {
            InitializeComponent();
            //richTextBox1.Text = Log.RecuperarLog();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            string ruta = "";
            OpenFileDialog openFileDialog = new OpenFileDialog();
            openFileDialog.Filter = "Biblioteca de Archivos |*.txt";
            openFileDialog.ShowDialog();
            ruta = ruta + openFileDialog.FileName;
            openFileDialog.FileName = "";
            richTextBox1.Text = null;
            try
            {
                richTextBox1.Text = Log.RecuperarLog(ruta);
            }
            catch (Exception) 
            {
                MessageBox.Show("No se puede cargar el archivo, revise la encriptación del mismo");
            }
        }
    }
}
